$(function () {

    $("#lost_datagrid").datagrid({
        fit: true,
        fitColumns: true,
        striped: true,
        toolbar: '#lost_toolbar',
        url:"/customerLost/list",
        pagination: true,
        singleSelect: true,
        rownumbers:true,
        columns: [[
            {field:'lostDate',title:'移交日期',width:100,align:'center'},

            {field:'cust',title:'客户',width:100,align:'center',formatter: function(value,row,index) {
                return value?value.name:""
            }
            },
            {field:'chargeUser',title:'当时负责人',width:100,align:'center',formatter: function(value,row,index) {
                return value?value.realName:""
            }
            },
            {field:'lostReason',title:'流失原因',width:100,align:'center'},
        ]],
    })
})

function reload() {
    $("#lost_datagrid").datagrid("reload");
}

function searchForm() {
    //获取输入的值
    var beginDate = $("[name=beginDate]").val();
    var endDate = $("[name=endDate]").val();
    var customer=$("[name=customer]").val();
    var chargeUser=$("[name=chargeUser]").val();
    $("#lost_datagrid").datagrid('load',{
        beginDate:beginDate,
        endDate:endDate,
        customer:customer,
        chargeUser:chargeUser,
    });
}









